'use strict';

/**
 * @param {Egg.Application} app - egg application
 */

module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);

  // ghr
  //验证码路由
	router.post('/egg/code', controller.guser.code);

	//注册路由
	router.post('/egg/register', controller.guser.register);

	// 登录路由;
	router.post('/egg/login', controller.guser.login);

	// 首页路由;
	router.post('/egg/shouye', controller.guser.shouye);

  // zjy
  // 查询所有用户
  router.get('/egg/select', controller.user.select);
  // 根据id查找用户
  router.get('/egg/select_id', controller.user.select_id);
  router.get('/egg/select_nickname', controller.user.select_nickname);
  router.get('/egg/select_sex', controller.user.select_sex);
  router.get('/egg/select_type', controller.user.select_type);
  // 添加用户
  router.post('/egg/adduser', controller.user.adduser);
  // 删除用户
  router.get('/egg/deleteuser', controller.user.deleteuser);
  // 素材审核
  router.get('/egg/shenhe', controller.sucai.shenhe);
  // 删除违规图片
  router.get('/egg/deleteimg', controller.sucai.deleteimg);
  // 添加设计趋势系列及系列图片
  router.post('/egg/design', controller.sucai.design);
  // 推荐内容
  router.get('/egg/tuijian', controller.discovery.tuijian);
  // 获取指定图片的相关信息
  router.get('/egg/detail', controller.discovery.detail);
  // 点赞图片
  router.get('/egg/good', controller.discovery.good);
  // 获取用户的所有画板
  router.get('/egg/drawborder', controller.discovery.drawborder);
  // 采集到画板
  router.get('/egg/gather_to', controller.discovery.gather_to);
  
  // thh
  //个人信息路由
	router.get('/egg/getuserinfo', controller.user.getuserinfo);

	// 修改个人信息
	router.get('/egg/setting', controller.user.setting);
	// 添加画板
	router.get('/egg/addraw', controller.user.addraw);

	// 关注
	router.get('/egg/concern', controller.concern.concern);
	// // 获取所有的作品
	// router.get('/egg/concern', controller.user.concern);
	// router.get('/egg/getAllmaterials', controller.getAllmaterials.getAllmaterial);

	// 上传图片路由;
	router.post('/egg/getimg', controller.guser.getimg);

	// 画板上传路由;
	router.post('/egg/huaban', controller.guser.huaban);
};
